package com.prototype.spring.test;


import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author 薛虎
 * @date 2020/12/29 10:35
 */
public class ProtoType {

    public static void main(String[] args) {
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("com/prototype/spring/beans.xml");
        // 获取monster[通过id获取monster]
        Object bean = applicationContext.getBean("id01");
        System.out.println("bean" + bean); // 输出 "牛魔王" .....

        Object bean2 = applicationContext.getBean("id01");

        System.out.println("bean2" + bean2); //输出 "牛魔王" .....

        System.out.println(bean == bean2); // false

        // ConfigurableApplicationContext
    }
}
